<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/print.css" />
<title>打印页</title>
</head>
<body>
<!--startprint-->
<%--
<div class="formtitle">住院病历复印申请单</div>
<table id="replicapaper" class="applyform" width="850" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100" height="30" align="center" valign="middle" class="formlabel applyform">患者姓名</td>
    <td colspan="2" align="center" valign="middle" class="applyform" id="PrintPage_fname"></td>
    <td align="center" valign="middle" class="formlabel applyform">身份证号</td>
    <td colspan="2" align="center" valign="middle" class="applyform" id="PrintPage_IDCard"></td>
  </tr>
  <tr>
    <td width="100" height="30" align="center" valign="middle" class="formlabel applyform">科室</td>
    <td width="100" align="center" valign="middle" class="applyform" id="PrintPage_fcydept"></td>
    <td rowspan="2" align="center" valign="middle" class="formlabel applyform">病案号</td>
    <td rowspan="2" align="center" valign="middle" class="applyform" id="PrintPage_fprn"></td>
    <td align="center" valign="middle" class="formlabel applyform">入院日期</td>
    <td align="center" valign="middle" class="applyform" style="width:20%" id="PrintPage_frydept"></td>
  </tr>
  <tr>
    <td width="100" height="30" align="center" valign="middle" class="formlabel applyform">床号</td>
    <td align="center" valign="middle" class="applyform" id="PrintPage_fcybs"></td>
    <td align="center" valign="middle" class="formlabel applyform">出院日期</td>
    <td align="center" valign="middle" class="applyform" id="PrintPage_fcydate"></td>
  </tr>
  <tr>
    <td width="100" height="30" align="center" valign="middle" class="formlabel applyform">代理人姓名</td>
    <td align="center" valign="middle" class="applyform" id="PrintPage_DLRname"></td>
    <td align="center" valign="middle" class="formlabel applyform">身份证号</td>
    <td align="center" valign="middle" class="applyform" id="PrintPage_DLRIDCard"></td>
    <td align="center" valign="middle" class="formlabel applyform">与患者关系</td>
    <td align="center" valign="middle" class="applyform" id="PrintPage_relation"></td>
  </tr>
  <tr>
    <td width="100" height="30" align="center" valign="middle" class="formlabel applyform">复印内容</td>
    <td colspan="5" align="center" valign="top" id="fysqd_fynr2" class="applyform">
    	<!-- <div id="fysqd_fynr"></div> -->
    	<table style="text-align:left;width:100%">
			<c:forEach items="${PrintModel}" var="model" varStatus="status" begin = "0" end = "29">
				<c:choose>
					<c:when test="${status.index%3 == 0 }">
						<tr>
					</c:when>
				</c:choose>
				<c:choose>
					<c:when test="${(status.index+1)%3 == 0 }">
						<td class="printPage_td">
							<label class="">
								<input type="checkbox" id="PrintPage_<c:out value="${model.FZJC }"/>" name="printModel" value="<c:out value="${model.FZJC }"/>">
								<span class="print_text"><c:out value="${model.FXMMC }"/></span>
							</label>
						</td>
						</tr>
					</c:when>
				<c:otherwise>
					<td class="printPage_td">
						<label class="">
							<input type="checkbox" id="content_<c:out value="${model.FZJC }"/>" name="printModel" value="<c:out value="${model.FZJC }"/>">
							<span class="print_text"><c:out value="${model.FXMMC }"/></span>
						</label>
					</td>
				</c:otherwise>
				</c:choose>
			</c:forEach>
		</table>
    </td>
  </tr>
  <tr>
    <td height="30" colspan="6" align="left" valign="middle" class="formlabel applyform pdleft">申请证件</td>
  </tr>
  <tr class="certificate">
    <td height="100%" colspan="6" align="center" valign="middle" class="applyform">
    	<table class="basymodule cardtable" >
    		<tr class="cardtr" >
    			<td class="basymodule idcard td" id="pic0" ></td>
    			<td class="basymodule idcard td" id="pic1"></td>
    		</tr>
    		<tr>
    			<td class="basymodule idcard td2" id="pic2"></td>
    			<td class="basymodule idcard td2" id="pic3"></td>
    		</tr>    		
    	</table>
    </td>
  </tr>
  <tr>
    <td height="80" colspan="6" align="right" valign="top" style="padding-right: 150px;" class="formlabel applyform">代理人签名（盖章）：</td>
  </tr>
</table>
  --%>

 
<div class="divbox">
    <span style="margin-top:12px;margin-left:12px;">
		<button type="button" id="confirmId" class="Noprint">确认打印</button>
		<span style="margin-left:10px;"></span>
		<button type="button" id="closeId" class="Noprint" onclick="unloadWin()">关闭</button>
    </span>
    
	<div class="ptitle">住院病历复印申请单</div>
	<table id="replicapaper" class="ptable" cellspacing="5">
	  <tr>
	    <td><label>患者姓名</label> <input type="text" name="" id="PrintPage_fname" /></td>
	    
	    <td>出院日期 <input type="text" name="" id="PrintPage_fcydate" /></td>
	    
	    <td>性别<input type="text" name="" id="PrintPage_IDSex" style="width:40px;" /> 
	        &nbsp;&nbsp;身份证号   <input type="text" name="" id="PrintPage_IDCard" /></td>
	  </tr> 
	  
	  <tr>
	    <td><label style="width:62px;">病案号</label><input type="text" name="" id="PrintPage_fprn" /></td>
	    
	    <td>出院科室<input type="text" name="" id="PrintPage_fcydept" /></td>
	    
	    <td><label style="width:70px;">复印原因  </label><input type="text" name="" id="PrintPage_purpose"  style="width:230px;"/></td>
	  </tr> 
	  
	   <tr>
	    <td><label style="width:62px;">申请人</label><input type="text" name="" id="PrintPage_DLRname" /></td>
	    
	    <td>人员分类<input type="text" name="" id="PrintPage_relation" /></td>
	    
	    <td><label style="width:70px;">身份证</label><input type="text" name="" id="PrintPage_DLRIDCard"  style="width:230px;"/></td>
	  </tr> 
	  
	  <tr>
	    <td colspan=3>复印该患者如下病历 <input type="text" name="" id="fysqd_fynr2"  style="width:630px;"/></td>
	  </tr> 
	  
	  <tr>
	    <td colspan=3>
	    	<table class="tableImg">
	    		<tr>
	    			<td  id="pic0" style="height:50%;width:50%"></td>
	    			<td  id="pic1"></td>
	    		</tr>
	    		<tr>
	    			<td  id="pic2"></td>
	    			<td  id="pic3"></td>
	    		</tr>    		
	    	</table>
	    </td>
	  </tr>
	  
	  <tr>
	    <td colspan="3"  style="height:50px;text-align:right;padding-right:10px;">申请人签字
	         <input type="text" name="" id=""/>
	    </td>
	  </tr>
	</table>
</div>
<!--endprint-->

<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/jquery.min.js"></script>
<script type="text/javascript">
	$(function(){ 
		$("input").attr("readonly",true);  //输入框只读
		
		//获取上级页面中的缓存信息数据
		var information = window.opener.cacheInfo;
		//获取上级页面缓存图片数据
		var images = window.opener.cacheImage;
		//获取上级页面缓存病案内容数据
		var content = window.opener.cacheContent;
		//填充数据
   	    for (var i = 0; i < information.length; i++) {
   		     
   	        document.getElementById("PrintPage_fname").value=information[0];
   	    	document.getElementById("PrintPage_IDCard").value=information[1];  
   	    	document.getElementById("PrintPage_fcydept").value=information[2];  
   	    	//document.getElementById("PrintPage_fcybs").value=information[3];  //床号
   	    	document.getElementById("PrintPage_fprn").value=information[4];
   	    	//document.getElementById("PrintPage_frydept").value=information[5];//入院日期
   	    	document.getElementById("PrintPage_fcydate").value=information[6];
   	    	document.getElementById("PrintPage_relation").value=information[7];
			if(i > 7){
				document.getElementById("PrintPage_DLRname").value=information[8];
				document.getElementById("PrintPage_DLRIDCard").value=information[9];
			}
			
			/* $("#PrintPage_fname").html(information[0]);
			$("#PrintPage_IDCard").html(information[1]);
			$("#PrintPage_fcydept").html(information[2]);
			$("#PrintPage_fcybs").html(information[3]);
			$("#PrintPage_fprn").html(information[4]);
			$("#PrintPage_frydept").html(information[5]);
			$("#PrintPage_fcydate").html(information[6]);
			$("#PrintPage_relation").html(information[7]);
			if(i > 7){
				$("#PrintPage_DLRname").html(information[8]);
				$("#PrintPage_DLRIDCard").html(information[9]);
			}  */
		} 
    
	    for (var j = 0; j < images.length; j++) {
			if(images[j]){
				$("#pic"+j).html("<img style='width:100%;height:100%;' src='data:image/jpg;base64,"+images[j]+"' />");
			}
		}
		
		for (var k = 0; k < content.length; k++) {
			console.info("内容打印===="+content[k]+"\n");
			$("input:checkbox[value='"+content[k]+"']").prop("checked",true);
			
		}  
	  
	});
	
	 function unloadWin(){  
	    window.close();
	 }
</script>
</body>
</html>